x11: Skip GenericEvents with no cookie data in the xi2 device manager
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 15 Jul 2011 16:33:44 +0000 (18:33 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 15 Jul 2011 16:33:44 +0000 (18:33 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=653947

It could happen that a cookie event has been already allocated/freed
in an event filter, as it can't be allocated a second time, all GDK
can do is skipping the event. Spotted by Guillaume Desmottes.

gdk/x11/gdkdevicemanager-xi2.c

index 5bd5500feacc49ae0a8b6a0f8e6e061e5d3fe848..425efeeab99430605dee448a3938865a4b74c490 100644 (file)
@@ -1025,6 +1025,9 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
 
   ev = (XIEvent *) cookie->data;
 
+  if (!ev)
+    return FALSE;
+
   window = get_event_window (translator, ev);
 
   if (window && GDK_WINDOW_DESTROYED (window))